#ifndef CHESSPLAY2_H
#define CHESSPLAY2_H
#include<QLabel>
#include <QMainWindow>
#include<QPushButton>
#include <QMainWindow>
#include <QMainWindow>
#include"proc.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class chessplay2;
}
QT_END_NAMESPACE

enum class Piece{
    Empty,
    Blck,
    White
};
class chessplay2 : public QMainWindow
{
    Q_OBJECT

public:
    chessplay2(QWidget *parent = nullptr);
    ~chessplay2();
    const int row=15;
    const int col=15;
    const int xsize=40;
    const int ysize=40;
    void prepare();
    void paintEvent(QPaintEvent*event);
    void drawchessboard();
    void drawchess();
    void drawchess1();
    void chessplace(QPainter&painter,QPoint&point);
    void mousePressEvent(QMouseEvent*event);
    int checkchess(chessitem item,QPoint pt);

    bool handchess_color;
    QPushButton*button,*button1;
    QLabel*label;
    QLabel*label_2;
    QVector<chessitem> chessItem;
private slots:
    void open();
 void back();
    void mainback();

private:
    Ui::chessplay2 *ui;
};
#endif // CHESSPLAY2_H
